#ifndef __CLAMP_H__
#define __CLAMP_H__

#include "sceneObject.h"
#include "clampSide.h"
#include "model/actions/grabber.h"

class Clamp : public SceneObject, public Grabber{
	private:

		typedef enum{ OPEN,CLOSING,OPENING,CLOSED } State;
		State state;
		static const float maxRotationAngle;
		static const float rotationSpeed;
		float zrotatedAngle;

		void initSides();
	public:
		Clamp(const Cube& cube,const Point& dir,const std::map<std::string,ObjectModelPtr>& models);
		~Clamp();

		void timeStep();

		void open();
		void close();

		void setModelMatrix();
		void setSubModelMatrix(const std::string& name="");
		void addObject(const std::string& name,SceneObject* obj);

		void rotate(float angle);
		void move(float dx,float dy,float dz);

		bool isOpen();
		bool isClosed();

		static std::string name() {
			return "clamp";
		}
};

#endif /* __CLAMP_SIDE_H__ */

